﻿<?php 

$title = $this->_global->_unserialize($posts->post_title);
$seo_title =$this->_global->_unserialize($posts->seo_title);
$seo_title=isset($seo_title[$this->session->userdata('lan')])?$seo_title[$this->session->userdata('lan')]['seo_title']:"";

$desc  = $this->_global->_unserialize($posts->post_desc);
$content = $this->_global->_unserialize($posts->post_content);
$al = $this->_global->_unserialize($posts->seo_alias);
_add_hit($posts->post_id);
if(!empty($al[$this->session->userdata('lan')])){
if($alias != $al[$this->session->userdata('lan')]['alias']){
    redirect('news/c'.$posts->cat_id.'/'.$posts->post_id.'-'.$al[$this->session->userdata('lan')]['alias']);
    }
}
else{
echo "Vui lòng nhập nội dung bài viết tương ứng với ngôn ngữ hiện tại";
}
   global $site_info;
$site_info['site_title']=$seo_title .' - '. $site_info['site_title'];
$site_info['metakey'] = $posts->metakey;
$site_info['metadesc'] = $posts->metadesc;
?><div class="content" style="padding: 0px;border: none;margin-top: 5px;">
<div class="content" style="float: none;">
<h1 class="title"><?php echo isset($title[$this->session->userdata('lan')])?$title[$this->session->userdata('lan')]['post_title']:"Không tồn tại tiêu đề bài viết với ngôn ngữ hiện tại"; ?><!-- Place this tag where you want the +1 button to render -->
<span></span>
</h1>
<?php 
    $relative_posts = _get_realtive_post($posts->cat_id,$posts->post_id);
   
    if(!empty($relative_posts)){
?>
    <ul class="relative_post">
         <?php 
        foreach($relative_posts as $re){
            $title = $this->_global->_unserialize($re->post_title);
            $title = $title[$this->session->userdata('lan')]['post_title'];
            $alias = $this->_global->_unserialize($re->seo_alias);
            $alias = $alias[$this->session->userdata('lan')]['alias'];
            echo '<li>'.anchor('news/c'.$re->cat_id.'/'.$alias.'-'.$re->post_id,'<span style="padding-right:5px;font-size:15px">&raquo;</span>'.$title,'title="'.$title.'"').'</li>';
        }
    ?>
    </ul>
<?php
    }
?>

<h2 class="clear" style="margin: 10px 0px;"><?php echo isset($desc[$this->session->userdata('lan')])?$desc[$this->session->userdata('lan')]['post_desc']:""; ?></h2>

<?php echo isset($content[$this->session->userdata('lan')])?$content[$this->session->userdata('lan')]['post_content']:""; ?>
<div class="clear"></div>
<div class="shadow-box"></div>
</div>
<!-- AddThis Button BEGIN -->
<div style="float:right;width:140px;margin-top:5px" class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<!-- AddThis Button END -->
<div class="clear"></div>
<ul id="tagline">
    <li><b>Tags:</b><?php $tags = $posts->tagline;
            if($tags!=''){
                $tags = explode(',',$tags);
                foreach($tags as $tag){
                    echo anchor('tags/'._set_alias(trim($tag)),$tag,'title="'.$tag.'"').',';
                }
            }
        ?></li>
    
    
</ul>
<?php 

unset($posts);
?>
</div>